//
//  UserAccount.m
//  iFlick1.4
//
//  Created by vhly on 10-9-11.
//  Copyright 2010 xhzhang. All rights reserved.
//

#import "UserAccount.h"


@implementation UserAccount


@synthesize nsid;

@synthesize userName;

@synthesize fullName;

@synthesize location;

@synthesize photosURL;

@synthesize profileURL;

@synthesize auth_token;

@synthesize perms;

- (id)initWithCoder:(NSCoder *)coder{
	self = [super init];
	
	nsid = [[coder decodeObjectForKey:@"nsid"] retain];
	userName =[[coder decodeObjectForKey:@"uname"] retain];
	fullName =[[coder decodeObjectForKey:@"fname"] retain];
	auth_token = [[coder decodeObjectForKey:@"token"] retain];
	perms = [[coder decodeObjectForKey:@"perms"] retain];
	location = [[coder decodeObjectForKey:@"loc"] retain];
	profileURL = [[coder decodeObjectForKey:@"profile"] retain];
	photosURL = [[coder decodeObjectForKey:@"photos"] retain];
    return self;
}

- (void)encodeWithCoder:(NSCoder *)coder
{
    // [super encodeWithCoder:coder];
    
	[coder encodeObject:nsid forKey:@"nsid"];
	[coder encodeObject:userName forKey:@"uname"];
	[coder encodeObject:fullName forKey:@"fname"];
	[coder encodeObject:auth_token forKey:@"token"];
	[coder encodeObject:perms forKey:@"perms"];
	[coder encodeObject:location forKey:@"loc"];
	[coder encodeObject:profileURL forKey:@"profile"];
	[coder encodeObject:photosURL forKey:@"photos"];
}

- (void)dealloc{
	[nsid release];
	[userName release];
	[fullName release];
	[location release];
	[photosURL release];
	[profileURL release];
	[auth_token release];
	[perms release];
	[super dealloc];
}

@end
